package utils.lang;

import lombok.extern.slf4j.Slf4j;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;

/**
 * @author shanks on 2019/5/28
 */
@Slf4j
public class FileUtil {

    public static boolean createFile(String filePath) {
        Path path = Paths.get(filePath);
        if (!Files.exists(path)) {
            try {
                Files.createDirectories(path.getParent());
                Files.createFile(path);
            } catch (IOException e) {
                log.error("createFile ERROR", e);
                return false;
            }
        }
        return true;
    }



}
